ul,
li {
    list-style: initial;
    /* 或者你想要的样式 */
    margin: initial;
    padding: initial;
}

.p-span-tag {
    background: #151515;
    border-radius: 3px;
    // cursor: pointer;
    transition: background 0.5s ease;
}

.p-span-tag:hover {
    background: transparent;
}

// .mark {
//     --lightness: 0.3;
//     --highlighted: 1;
//     --highlight: oklch(0.7615079135428947 0.09231108114676398 142.7893255428089 / 0.3);
//     color: #000000cc;

//     &-span {
//         --highlight: oklch(0.7615079135428947 0.09231108114676398 142.7893255428089 / 0.3);
//         background: linear-gradient(120deg, var(--highlight, #add8e6) 50%, #0000 50%) 110% 0 / 200% 100% no-repeat;
//         background-position: calc((1 - var(--highlighted))* 110%) 0;
//         transition: background-position 1s;
//     }
// }

.mark {
    --lightness: 0.3;
    --highlighted: 0;
    /* 初始状态为0 */
    --highlight: oklch(0.7615079135428947 0.09231108114676398 142.7893255428089 / 0.3);
    color: #000000cc;

    &-span {
        --highlight: oklch(0.7615079135428947 0.09231108114676398 142.7893255428089 / 0.3);
        background: linear-gradient(120deg, var(--highlight, #add8e6) 50%, #0000 50%) 110% 0 / 200% 100% no-repeat;
        background-position: calc((1 - var(--highlighted)) * 110%) 0;
        transition: background-position 1s;

        /* 动画激活状态 */
        &.animate-in {
            --highlighted: 1;
        }
    }
}

@supports (animation-timeline:view()) {
    .mark {
        --highlighted: 0;
        background: #0000;
        animation: markdown_highlight__gm6CE steps(1) both;
        animation-timeline: view();
        animation-range: entry 100% cover 10%;
    }
}

@keyframes markdown_highlight__gm6CE {
    100% {
        --highlighted: 1;
    }
}

.m-block {
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    padding: 20px;
    margin: 20px 0;

    span {
        font-size: 1rem;
    }

    iframe {
        border: 0;
        width: 1.5em;
        height: 1.5em;
    }

    svg:root {
        color: rgb(245, 158, 11) !important;
    }
}

.warning {
    background: rgb(255 251 235);
    border: solid 1px rgb(252 211 77);
}

.error {
    background: rgb(255 235 235);
    border: solid 1px rgb(252 77 77);
}

.md-a-img {
    width: 17px;
    vertical-align: sub;
    pointer-events: none;
    background: transparent !important;
}

.hover-link {
    position: relative !important;
    text-decoration: underline !important;
    color: #3d92ff !important;
    text-decoration-color: rgba(241, 137, 46, 0.479) !important;
}

.hover-link::before {
    content: "";
    position: absolute;
    bottom: 0px;
    left: 0;
    height: 1.5px;
    background-color: #f0487b8e;
    width: 0;
    -webkit-transition: width 0.5s linear;
    transition: width 0.5s linear;
    text-decoration: none;
}

.hover-link:hover::before {
    width: 100%;
    -webkit-transition: width 0.5s linear;
    transition: width 0.5s linear;
}

.p-a-div {
    display: none;
    /* 默认隐藏 */
    position: absolute;
    // top: 50%;
    /* 在 a 标签下方 */
    // left: 0;
    margin-top: 2px;
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    padding: 10px;
    z-index: 1000;
    background: rgb(251, 251, 250);
    // animation: dropdown 0.3s;
    box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.12);
    border-radius: 5px;
}

@keyframes dropdown {
    0% {
        -webkit-transform: translateY(10px);
        transform: translateY(10px);
        opacity: 0.1;
    }

    50% {
        opacity: 1;
    }

    100% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

@keyframes fadeout {
    0% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        -webkit-transform: translateY(10px);
        transform: translateY(10px);
        opacity: 0;
    }
}

.slide-top {
    -webkit-animation: slide-top 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    animation: slide-top 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@-webkit-keyframes slide-top {
    0% {
        -webkit-transform: translateY(10px);
        transform: translateY(10px);
    }

    100% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

@keyframes slide-top {
    0% {
        -webkit-transform: translateY(10px);
        transform: translateY(10px);
    }

    100% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

.p-a-span {
    display: none;
    position: absolute;
    margin-top: 2px;
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    padding: 10px;
    z-index: 1000;
    background: rgb(251, 251, 250);
    animation: dropdown 0.3s;
    box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.12);
    border-radius: 5px;
    max-width: 400px;
    overflow-wrap: break-word;
    position: absolute;
    margin-top: 4px;
    opacity: 1;
}

/* 进入动画 */
.p-a-span.dropdown {
    animation: dropdown 0.3s forwards;
}

/* 退出动画 */
.p-a-span.fade-out {
    animation: fadeout 0.3s forwards;
}

.p-a-span.align-left {
    left: 0;
    right: auto;
    transform-origin: top left;
}

.p-a-span.align-right {
    right: 0;
    left: auto;
    transform-origin: top right;
}

.p-a-span.align-center {
    transform-origin: top center;
}

.p-a-span:hover {
    display: block;
}

.hover-link:hover~.p-a-span {
    color: #000;
    display: block;
}

.admonition-content p {
    margin-bottom: 0px !important;
}

.link-card-container {
    display: flex;
    justify-content: center;
    margin: 1rem auto;
}

.link-card {
    padding: 1rem;
    background: #f6f6f6;
    display: flex;
    gap: 1rem;
    border-radius: 10px;
    border: 1px solid #c4c5c6;
    max-width: 24rem;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.link-card:hover {
    border-color: #4285f4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.link-content {
    flex: 1;
    overflow: hidden;
    text-decoration: none !important;
    color: inherit;

    p {
        margin-bottom: 0 !important;
    }
}

.link-title {
    margin: 0;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-url {
    margin: 4px 0 0 0;
    font-size: 0.8rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-avatar {
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #e5e7eb;
    background-size: cover;
}

.link-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 添加加载失败指示器 */
.link-avatar::after {
    content: "❌";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.link-avatar[data-error]::after {
    opacity: 1;
}

.m-code-block {
    background: rgba(251, 192, 192, 0.558);
    border: solid 1px rgba(251, 192, 192, 0.801);
    overflow-x: auto;
    white-space: nowrap;

    border-radius: 10px;

    div {
        margin: 1rem;
    }

    p {
        margin-bottom: 0 !important;
    }
}

.md-collapse {
    // border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
    margin: 1em 0;
    transition: all 1.4s ease;

    &-icon {
        transition: transform 0.3s ease;
        background-image: url('@/assets/svg/down-line.svg');
        display: inline-block;
        width: 24px;
        height: 24px;
        background-size: contain;
        transform: scale(0.7) rotate(-90deg);
        background-repeat: no-repeat;
    }
}

.md-collapse-title {
    padding: 10px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 2px;

    &:hover {
        color: #023e6f;
    }
}

.md-collapse-body {
    border-radius: 6px;
    height: 0;
    overflow: hidden;
    will-change: height;
    transition: height .5s cubic-bezier(0.25, 1.5, 0.5, 1); // 弹性曲线
}


.md-collapse-body.open {
    /* 用 JS 动态计算高度 */
    background: #ffc0cb33;
}

.md-collapse-icon.rotate {
    transform: scale(0.7) rotate(0deg);
}


.md-collapse-inner {
    padding: 10px;
    background: #fff0f5;
    animation: bounceIn 0.3s ease;
}

@keyframes bounceIn {
    0% {
        transform: scaleY(0.95);
    }

    50% {
        transform: scaleY(1.05);
    }

    100% {
        transform: scaleY(1);
    }
}

.carousel-wrapper {
    position: relative;
    // width: 600px;
    height: 400px;
    margin: auto;
}

.container {
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    display: flex;
    scroll-behavior: smooth;
    height: 400px;
    max-width: 600px;
    position: relative;
    padding: 0 60px; // 留出两边露出空间
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    scroll-behavior: smooth;

    &::-webkit-scrollbar {
        display: none;
    }

    &-item {
        scroll-snap-align: start;
        scroll-snap-stop: always;
        scroll-snap-align: center;
        flex-shrink: 0;
        width: 80%; // 比容器小，留出露出空间
        margin: 0 10px; // 间距，影响计算
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 2rem;
        color: white;
        position: relative;
        transition: transform 0.3s ease, opacity 0.3s ease;
        cursor: pointer;
        opacity: 0.6;
        transform: scale(0.9);
        z-index: 1;
        will-change: transform, opacity;
        backface-visibility: hidden;
        /* 切面优化 */
        transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;

        img {
            width: 100% !important;
            height: auto;
            display: block;
            border-radius: 8px;
            user-select: none;
        }

        &.active {
            transform: scale(1);
            opacity: 1;
            z-index: 3;
        }

        &.peek-prev,
        &.peek-next {
            transform: scale(0.92);
            opacity: 0.8;
            z-index: 2;
        }
    }

    &-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        border: none;
        color: white;
        cursor: pointer;
        user-select: none;
        width: 2rem;
        height: 2rem;
        background-color: rgba(184, 182, 182, 0.904);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 5;
        transition: background-color 0.3s;

        &:hover {
            background-color: rgba(249, 247, 247, 0.6);
        }

        &.prev {
            left: 10px;
        }

        &.next {
            right: 10px;
        }
    }

    &-indicators {
        margin-top: -30px;
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: -25px;
        z-index: 10;
        position: relative;
        display: flex;
        justify-content: center;
        gap: 8px;
        padding: 6px 12px;
        border-radius: 999px;
        background: #e4e4e4d9;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;

        .dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: #bbb;
            cursor: pointer;
            transition: background 0.3s;

            &.active {
                background: #444;
            }
        }
    }
}

.md-video-wrapper {
    position: relative;
    width: 100%;
    max-width: 720px;
    aspect-ratio: 16 / 9;
    margin: 3.5em auto;
}

.md-video-iframe,
.md-video {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    border-radius: 8px;
    z-index: 1;
}

.md-video-description {
    position: absolute;
    z-index: 0;
    width: 100%;
    padding-top: 58.25%;
    text-align: center;
    font-size: 0.65em;
    color: #666;
    font-style: italic;
}